<template>
  <div id="app" class="full">
    <router-view v-if="requestOver && requestOver2" @update="getWxInfo"/>
  </div>
</template>

<script>
export default {
  name: 'App',
  data () {
    return {
      userInfo: null,
      requestOver: false,
      requestOver2: false
    }
  },
  mounted () {
    // this.getData()
  },
  created () {
    this.getWxInfo();
    this.findHomeList();
  },
  methods: {
    /*
    async getData () {
      let res = await this.$http.post('initQuestion');
      console.log(res)
    },
    */
    async findHomeList () {
      let res = await this.$http.post('findHomeList', );
      this.$root.index = res.data.data;
      this.requestOver2 = true;
    },
    async getWxInfo () {
      let res = await this.$http.post('getWxInfo', {
        wxId: this.$root.wxId
      });
      if (res.data && res.data.data) {
        this.userInfo = res.data.data;
        this.$root.userInfo = this.userInfo;
        // this.$root.wxId = this.userInfo.wxId;
      }
      this.requestOver = true;
      console.log(res)
    }
  }
}
</script>

<style>
#app {

}
</style>
